<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>选择爱好</title>
		<script src="js/jquery.min.js"></script>
		<!-- <script type="text/javascript" src="checkbox.js"></script> -->
	</head>
<body>
	<!-- action是后台地址 -->
	<form method="post" action="">
	   	你爱好的运动是？<input type="checkbox" id="checkedAll_2"/>全选/全不选
	   	<br/>
	    <input type="checkbox" name="items" value="足球"/>足球
		<input type="checkbox" name="items" value="篮球"/>篮球
		<input type="checkbox" name="items" value="羽毛球"/>羽毛球
		<input type="checkbox" name="items" value="乒乓球"/>乒乓球
	   	<br/>
	    <input type="button" id="CheckedAll" value="全　选"/>
	</form>
</body>
<script type="text/javascript">
	$(function(){
		$("#CheckedAll").click(function(){
			$(":checkbox[name=items]").attr("checked", true);
			$("#checkedAll_2").attr("checked", true);
		});
	});
</script>
</html>
